﻿using System;

namespace AQMProject
{
    public class ShareData
    {
        public enum DynamicType
        {
            Open,
            High,
            Low,
            Close,
            AdjustedClose
        }

        public DateTime Date { get; set; }
        public float Open { get; set; }
        public float High { get; set; }
        public float Low { get; set; }
        public float Close { get; set; }
        public float Volume { get; set; }
        public float AdjustedClose { get; set; }

        public double RenditeStetigAdjustedClose { get; set; }

        public double HillEstimator { get; set; }

        public void calculateRendite(ShareData beforeShare)
        {
            if (beforeShare == null) return;

            RenditeStetigAdjustedClose = ln(AdjustedClose / beforeShare.AdjustedClose);

        }

        private double ln(double value)
        {
            return Math.Log(value) / Math.Log(Math.E);
        }

    }
}
